<div class="col col-sm-offset-3">

    <div class="alert alert-info">
        <small>* For hosts, paths, methods and protocols, press enter to apply every value you type</small>
    </div>
</div>
<div class="form-group" ng-class="{'has-error' : errors.name}">
    <label class="col-sm-3 control-label">Name <br><em><small class="help-block">optional</small></em></label>
    <div class="col-sm-9">
        <input ng-model="route.name" class="form-control">
        <div class="text-danger" ng-if="errors.name" data-ng-bind="errors.name"></div>
        <p class="help-block">
            The name of the Route.
        </p>
    </div>
</div>
<div class="form-group" ng-class="{'has-error' : errors.hosts}">
    <label class="col-sm-3 control-label">Hosts <br><em><small class="help-block">semi-optional</small></em></label>
    <div class="col-sm-9">
        <chips ng-model="route.hosts">
            <chip-tmpl>
                <div class="default-chip">
                    {{chip}}
                    <i class="mdi mdi-close" remove-chip></i>
                </div>
            </chip-tmpl>
            <input chip-control/>
        </chips>
        <!--<input ng-model="route.hosts" class="form-control">-->
        <div class="text-danger" ng-if="errors.hosts" data-ng-bind="errors.hosts"></div>
        <p class="help-block">
            A list of domain names that match this Route. For example: example.com. At least one of hosts, paths, or methods must be set.
        </p>
    </div>
</div>
<div class="form-group" ng-class="{'has-error' : errors.paths}">
    <label class="col-sm-3 control-label">Paths <br><em><small class="help-block">semi-optional</small></em></label>
    <div class="col-sm-9">
        <chips ng-model="route.paths">
            <chip-tmpl>
                <div class="default-chip">
                    {{chip}}
                    <i class="mdi mdi-close" remove-chip></i>
                </div>
            </chip-tmpl>
            <input chip-control/>
        </chips>
        <p class="help-block">
            A list of paths that match this Route. For example: /my-path. At least one of <code>hosts</code>, <code>paths</code>, or <code>methods</code> must be set.
        </p>
    </div>
</div>
<div class="form-group" ng-class="{'has-error' : errors.regex_priority}">
    <label class="col-sm-3 control-label">Regex priority <br><em><small class="help-block">optional</small></em></label>
    <div class="col-sm-9">
        <input type="number" class="form-control" ng-model="route.regex_priority">
        <p class="help-block">
            A number used to choose which route resolves a given request when several routes match it using regexes simultaneously.
            When two routes match the path and have the same <code>regex_priority</code>, the older one (lowest <code>created_at</code>) is used.
            Note that the priority for non-regex routes is different (longer non-regex routes are matched before shorter ones).
            Defaults to <code>0</code>.
        </p>
    </div>
</div>
<div class="form-group" ng-class="{'has-error' : errors.methods}">
    <label class="col-sm-3 control-label">Methods <br><em><small class="help-block">semi-optional</small></em></label>
    <div class="col-sm-9">
        <chips ng-model="route.methods">
            <chip-tmpl>
                <div class="default-chip">
                    {{chip}}
                    <i class="mdi mdi-close" remove-chip></i>
                </div>
            </chip-tmpl>
            <input chip-control/>
        </chips>
        <p class="help-block">
            A list of HTTP methods that match this Route. At least one of <code>hosts</code>, <code>paths</code>, or <code>methods</code> must be set.
        </p>
    </div>
</div>
<div class="form-group">
    <label class="col-sm-3 control-label">Strip Path
        <br><em><small class="help-block">optional</small></em></label>
    <div class="col-sm-9">
        <input

                bs-switch
                ng-model="route.strip_path"
                switch-size="small"
                type="checkbox"
                switch-on-text="YES"
                switch-off-text="NO"
        >
        <p class="help-block">
            When matching a Route via one of the <code>paths</code>, strip the matching prefix from the upstream request URL.
        </p>
    </div>
</div>
<div class="form-group">
    <label class="col-sm-3 control-label">Preserve Host
        <br><em><small class="help-block">optional</small></em></label>
    <div class="col-sm-9">
        <input

                bs-switch
                ng-model="route.preserve_host"
                switch-size="small"
                type="checkbox"
                switch-on-text="YES"
                switch-off-text="NO"
        >
        <p class="help-block">
            When matching a Route via one of the <code>hosts</code> domain names,
            use the request <code>Host</code> header in the upstream request headers.
            By default set to <code>false</code>, and the upstream Host header will be that of the Service's <code>host</code>
        </p>
    </div>
</div>
<div class="form-group" ng-class="{'has-error' : errors.protocols}">
    <label class="col-sm-3 control-label">Protocols <br><em><small class="help-block">semi-optional</small></em></label>
    <div class="col-sm-9">
        <chips ng-model="route.protocols">
            <chip-tmpl>
                <div class="default-chip">
                    {{chip}}
                    <i class="mdi mdi-close" remove-chip></i>
                </div>
            </chip-tmpl>
            <input chip-control/>
        </chips>
        <p class="help-block">
            A list of the protocols this Route should allow. By default it is <code>["http", "https"]</code>,
            which means that the Route accepts both. When set to <code>["https"]</code>,
            HTTP requests are answered with a request to upgrade to HTTPS.
        </p>
    </div>
</div>

<!--
<div class="form-group" ng-class="{'has-error' : errors.snis}">
    <label class="col-sm-3 control-label">SNIs <br><em><small class="help-block">semi-optional</small></em></label>
    <div class="col-sm-9">
        <chips ng-model="route.snis">
            <chip-tmpl>
                <div class="default-chip">
                    {{chip}}
                    <i class="mdi mdi-close" remove-chip></i>
                </div>
            </chip-tmpl>
            <input chip-control/>
        </chips>
        <p class="help-block">
            A list of SNIs that match this Route when using stream routing.
            When using <code>tcp</code> or <code>tls</code> protocols, at least one of <code>snis</code>, <code>sources</code>, or <code>destinations</code> must be set.
        </p>
    </div>
</div>
<div class="form-group" ng-class="{'has-error' : errors.sources}">
    <label class="col-sm-3 control-label">Sources <br><em><small class="help-block">semi-optional</small></em></label>
    <div class="col-sm-9">
        <chips ng-model="route.sources">
            <chip-tmpl>
                <div class="default-chip">
                    {{chip}}
                    <i class="mdi mdi-close" remove-chip></i>
                </div>
            </chip-tmpl>
            <input chip-control/>
        </chips>
        <p class="help-block">
            A list of IP sources of incoming connections that match this Route when using stream routing.
            Each entry is an object with fields “ip” (optionally in CIDR range notation) and/or “port”.
            When using <code>tcp</code> or <code>tls</code> protocols, at least one of <code>snis</code>, <code>sources</code>, or <code>destinations</code> must be set.
        </p>
    </div>
</div>
<div class="form-group" ng-class="{'has-error' : errors.destinations}">
    <label class="col-sm-3 control-label">Destinations <br><em><small class="help-block">semi-optional</small></em></label>
    <div class="col-sm-9">
        <chips ng-model="route.destinations">
            <chip-tmpl>
                <div class="default-chip">
                    {{chip}}
                    <i class="mdi mdi-close" remove-chip></i>
                </div>
            </chip-tmpl>
            <input chip-control/>
        </chips>
        <p class="help-block">
            A list of IP destinations of incoming connections that match this Route when using stream routing. Each entry is an object with fields “ip” (optionally in CIDR range notation) and/or “port”.
            When using <code>tcp</code> or <code>tls</code> protocols, at least one of <code>snis</code>, <code>sources</code>, or <code>destinations</code> must be set.
        </p>
    </div>
</div>
-->